<?php

namespace App\Providers;

use App\Events\Register;
use Illuminate\Support\Facades\Event;
use Illuminate\Auth\Events\Registered;
use Illuminate\Auth\Listeners\SendEmailVerificationNotification;
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;

class EventServiceProvider extends ServiceProvider
{
    /**
     * The event listener mappings for the application.
     *
     * @var array
     */
    protected $listen = [
        'App\Events\UserEvent'=>[
            'App\Listeners\UserEventSubscriber',
        ],
        'App\Events\PostsSaved'=>[
            'App\Listeners\Notify',
        ],
       'Illuminate\Auth\Events\Registered' => [
           'App\Listeners\LogRegisteredUser',
           // 发送广告邮件
           'App\Listeners\SendAdMail',
           // 发送短信
           'App\Listeners\SendSms',
           // 发送帮助信息
           'App\Listeners\SendHelpInformation',
       ],

       'Illuminate\Auth\Events\Attempting' => [
           'App\Listeners\LogAuthenticationAttempt',
       ],

       'Illuminate\Auth\Events\Authenticated' => [
           'App\Listeners\LogAuthenticated',
       ],

       'Illuminate\Auth\Events\Login' => [
           'App\Listeners\LogSuccessfulLogin',
       ],

       'Illuminate\Auth\Events\Failed' => [
           'App\Listeners\LogFailedLogin',
       ],

       'Illuminate\Auth\Events\Logout' => [
           'App\Listeners\LogSuccessfulLogout',
       ],

       'Illuminate\Auth\Events\Lockout' => [
           'App\Listeners\LogLockout',
       ],

       'Illuminate\Auth\Events\PasswordReset' => [
           'App\Listeners\LogPasswordReset',
       ],
    ];


    /**
     * 需要注册的订阅者类。
     *
     * @var array
     */
    protected $subscribe = [
        'App\Listeners\UserEventSubscriber',
    ];


    /**
     * Register any events for your application.
     *
     * @return void
     */
    public function boot()
    {
        parent::boot();

        //
    }

}
